package com.poz.plotview;

import java.security.InvalidParameterException;

import com.poz.plotview.PlotView.HALIGN;
import com.poz.plotview.PlotView.VALIGN;

import android.graphics.Bitmap;
import android.graphics.PathEffect;

public class Seria {
	public float[] x;
	public float[] y;
	public String mLabel;
    public int mColor;
    private int n;
    
    public int sz() {
    	return n;
    }

    // computed values
    public float minx, miny, maxx, maxy;
	public int mWidth;
	public PathEffect mEffect;
	public Bitmap[] bms;
	public String[] texts;
	public HALIGN hAlign = HALIGN.CENTER;
	public VALIGN vAlign = VALIGN.CENTER;
	public float deg = 0;
	
	public Seria(float[] x, float[] y) {
		if (x.length != y.length) {
			throw new InvalidParameterException("X and Y must be with the same length");
		}
		this.x = x;
		this.y = y;
		this.n = x.length;
		
		// update min and max values
		minx = x[0];
        maxx = x[0];
        miny = y[0];
        maxy = y[0];
        for (int i = 0; i < n; i++) {
        	if (x[i] > maxx) {
        		maxx = x[i];
        	}
        	if (x[i] < minx) {
        		minx = x[i];
        	}
        	if (y[i] > maxy) {
        		maxy = y[i];
        	}
        	if (y[i] < miny) {
        		miny = y[i];
        	}
        }
	}
}
